package dw.common;

import java.io.Serializable;
import java.util.List;

import org.springframework.transaction.annotation.Transactional;

@Transactional(readOnly = true)
public interface GenericService<T, ID extends Serializable, EX extends Exception> {

  @Transactional(readOnly = false)
  public void save(T t) throws EX;

  @Transactional(readOnly = false)
  public void update(T t) throws EX;

  @Transactional(readOnly = false)
  public void delete(T t) throws EX;

  @Transactional(readOnly = false)
  void delete(ID id) throws EX;

  public T findById(ID id);

  public List<T> findByIds(String propertyNameOfId, List<ID> collectionOfIds);

  public List<T> findAll();

}